package com.hd.trans.files.bean;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author qianjujun
 * @email qianjujun@163.com
 * @createTime 2020/9/23 15:48
 * @describe
 */
public class Album implements Parcelable {
    private String mId;
    private Uri mCoverUri;
    private String mDisplayName;
    private long mCount;


    public Album(String id, Uri coverUri, String albumName, long count) {
        mId = id;
        mCoverUri = coverUri;
        mDisplayName = albumName;
        mCount = count;
    }

    public Album() {
        this.mId = "-1";
    }

    public String getmId() {
        return mId;
    }

    public void setmId(String mId) {
        this.mId = mId;
    }

    public Uri getmCoverUri() {
        return mCoverUri;
    }

    public void setmCoverUri(Uri mCoverUri) {
        this.mCoverUri = mCoverUri;
    }

    public String getmDisplayName() {
        return mDisplayName;
    }

    public void setmDisplayName(String mDisplayName) {
        this.mDisplayName = mDisplayName;
    }

    public long getmCount() {
        return mCount;
    }

    public void setmCount(long mCount) {
        this.mCount = mCount;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.mId);
        dest.writeParcelable(this.mCoverUri, flags);
        dest.writeString(this.mDisplayName);
        dest.writeLong(this.mCount);
    }

    public void readFromParcel(Parcel source) {
        this.mId = source.readString();
        this.mCoverUri = source.readParcelable(Uri.class.getClassLoader());
        this.mDisplayName = source.readString();
        this.mCount = source.readLong();
    }

    protected Album(Parcel in) {
        this.mId = in.readString();
        this.mCoverUri = in.readParcelable(Uri.class.getClassLoader());
        this.mDisplayName = in.readString();
        this.mCount = in.readLong();
    }

    public static final Creator<Album> CREATOR = new Creator<Album>() {
        @Override
        public Album createFromParcel(Parcel source) {
            return new Album(source);
        }

        @Override
        public Album[] newArray(int size) {
            return new Album[size];
        }
    };
}
